    //
//  HttpRequest.h
//  IM_LearningGYDF
//
//  Created by gydf on 16/3/10.
//  Copyright © 2016年 mac. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"
#import "UploadParam.h"

//typedef void (^success) (id responseObject);
//typedef void (^failure) (id error);

/** *
 */
typedef NS_ENUM(NSUInteger,HttpRequestType) {
    /**
     * get */
    HttpRequestTypeGet = 0,
    /**
     * post*/
    HttpRequestTypePost
};


@interface HttpRequest : NSObject
/**
 * get *
 * @param   URLString   请求的网址字符串
 * @param   parameters  请求的参数
 * @param   success     请求成功的回调
 * @param   failure     请求失败的回调
 */
+ (void)getWithURLString:(NSString *)URLString
              parameters:(id)parameters
                 success:(void (^)(id responseObject))success
                 failure:(void (^)(NSError *error))failure;
/**
 * post *
 * @param   URLString   请求的网址字符串
 * @param   parameters  请求的参数
 * @param   success     请求成功的回调
 * @param   failure     请求失败的回调
 */
+ (void)postWithURLString:(NSString *)URLString parameters:(id)parameters
                  success:(void (^)(id responseObject))success
                  failure:(void (^)(NSError *error))failure;

/** * *
 * @param   URLString   请求的网址字符串
 * @param   parameters  请求的参数
 * @param   type        请求的类型

 */
+ (void)requestWithURLString:(NSString *)URLString parameters:(id)parameters
                        type:(HttpRequestType)type
                     success:(void (^)(id responseObject))success
                     failure:(void (^)(NSError *error))failure;
/** * *
 * @param   URLString   请求的网址字符串
 * @param   parameters  上传图片的参数
 * @param   uploadParam 上传图片的信息
 * @param   success     上传成功的回调
 * @param   failure     上传失败的回调
 */
+ (void)uploadWithURLString:(NSString *)URLString parameters:(id)parameters
                uploadParam:(UploadParam *)uploadParam
                    success:(void (^)(id responseObject))success
                    failure:(void (^)(NSError *error))failure;
/** * *
 * @param   url         请求的网址字符串
 * @param   soapMthod   接口名称
 * @param   soapBody    soap信息
 * @param   success     上传成功的回调
 * @param   failure     上传失败的回调
 */
+ (void)SOAPData:(NSString *)url
       SoapMthod:(NSString *)soapMthod
        soapBody:(NSString *)soapBody
         success:(void (^)(id responseObject))success
         failure:(void(^)(NSError *error))failure;

/** * *
 * @param   urlString   请求的网址字符串
 * @param   filePath    下载路径
 * @param   success     下载成功的回调
 * @param   failure     下载失败的回调
 */
+ (void)downLoadWithUrlString:(NSString *)urlString
                     failPath:(NSString *)filePath
                      success:(void (^)(id responseObject))success
                      failure:(void(^)(NSError *error))failure;

+ (BOOL)isNotNetwork;
@end
